package com.example.javadesign.prototype.general;

/**
 * @author 陳樂
 * @version 1.0.0
 * @ClassName ConcretePrototype.java
 * @Description TODO
 * @createTime 2022年08月21日 20:30:00
 */
public class ConcretePrototype  implements IPrototype{

    private int age;

    private String name;

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public ConcretePrototype clone() {
        ConcretePrototype current = new ConcretePrototype();
        current.setAge(this.age);
        current.setName(this.name);
        return current;
    }

    @Override
    public String toString() {
        return "ConcretePrototype{" +
                "age=" + age +
                ", name='" + name + '\'' +
                '}';
    }
}
